package com.imooc.o2o.service;

import com.imooc.o2o.dto.LocalAuthExecution;
import com.imooc.o2o.exception.LocalAuthOperationException;
import com.imooc.o2o.entity.LocalAuth;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

/**
 * Created by Knight on 2018/7/16.
 */
public interface LocalAuthService {
    /**
     * 通过账号和密码获取平台账号信息
     * @param userName
     * @return
     */
    LocalAuth getLocalAuthByUserNameAndPwd(String userName, String password);

    /**
     * 通过userId获取平台账号信息
     * @param userId
     * @return
     */
    LocalAuth getLocalAuthByUserId(long userId);



    /**
     *
     * @param localAuth
     * @return
     * @throws RuntimeException
     */
    LocalAuthExecution bindLocalAuth(LocalAuth localAuth)throws LocalAuthOperationException;

    /**
     *
     * @param userId
     * @param userName
     * @param password
     * @param newPassword
     * @return
     */
    LocalAuthExecution modifyLocalAuth(Long userId, String userName,String password, String newPassword) throws LocalAuthOperationException;

    /**
     * 绑定微信,生成平台专属账号
     * @param localAuth
     * @param profileImg
     * @return
     * @throws RuntimeException
     */
//    LocalAuthExecution register(LocalAuth localAuth, CommonsMultipartFile profileImg) throws LocalAuthOperationException;

}

